﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ODM_Code.Forms
{
    public partial class ProgressForm : Form
    {
        public ProgressForm()
        {
            InitializeComponent();
        }

        public ProgressForm(int minimumVal, int maximumVal, int step)
        {
            InitializeComponent();
            progLabel.Text = "";
            progBar.Minimum = minimumVal;
            progBar.Maximum = maximumVal;
            progBar.Step = step;
        }

        public ProgressForm(String progressMessage, int minimumVal, int maximumVal, int step)
        {
            InitializeComponent();
            progLabel.Text = progressMessage;
            progBar.Minimum = minimumVal;
            progBar.Maximum = maximumVal;
            progBar.Step = step;
        }

        /// <summary>
        /// Sets the text of the label and refreshes the form
        /// </summary>
        /// <param name="updateText">Message to be displayed on form</param>
        public void SetProgressLabel(string updateText)
        {
            this.progLabel.Text = updateText;
            this.Refresh();
        }

        /// <summary>
        /// Calls PerformStep() on the progress bar
        /// </summary>
        public void StepBar()
        {
            this.progBar.PerformStep();
        }

        public void UpdateBar()
        {
            this.progBar.Update();
        }

        public void RefreshBar()
        {
            this.progBar.Refresh();
        }

    }
}
